package org.sunflower.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.server.ServerWebExchange;
import org.sunflower.feign.TestFeignClient;

@RestController
@RequestMapping("/test")
@Slf4j
public class TestController {
    @Autowired
    private TestFeignClient testFeignClient;

    @GetMapping
    public String test() {
        return testFeignClient.hello();
    }

    @GetMapping("/{id}")
    public String get(ServerWebExchange exchange, @PathVariable String id) {
        return id;
    }
}
